package com.edushare.common.vo;

import java.util.Date;

import com.edushare.common.vo.auto._Schedules;

public class Schedules extends _Schedules implements
	DateComparision {

	private static final long serialVersionUID = -4639756558514831716L;

	public static final int EVENT_STATUS_OPEN 			= 0;
	public static final int EVENT_STATUS_CANCELLED 		= 1;
	public static final int EVENT_STATUS_OVER 			= 2;

	public static final int EVENT_ONCE_ONLY 			= 0;
	public static final int EVENT_DAILY 				= 1;
	public static final int EVENT_WEEKLY 				= 2;
	public static final int EVENT_MONTHLY 				= 3;
	
	public static final int CREATOR_TYPE_UNIV 			= Messages.RECEIVER_TYPE_UNIVERSITY;
	public static final int CREATOR_TYPE_DEPT 			= Messages.RECEIVER_TYPE_DEPARTMENT;
	public static final int CREATOR_TYPE_COURSE 		= Messages.RECEIVER_TYPE_COURSE;
	public static final int CREATOR_TYPE_USER 			= Messages.RECEIVER_TYPE_USER;
	
	public Schedules() {
		setSchDesc("");
		setSchLocation("");
		setRepetitionEnd(new Date());
		setFrequency(EVENT_ONCE_ONLY);
		setSchType(Messages.PRIVACY_TYPE_PUBLIC);
	}

	public int compareTo(IDateComparable o) {
		if(getDate().getTime() < o.getDate().getTime())
			return -1;
		else if(o.getDate().getTime() == getDate().getTime())
			return 0;
		else
			return 1;
	}

	public Date getDate() {
		return getSchStart();
	}
}
